Loading TOC...

MarkLogic Server 11.0 Product Documentation
GET /v1/ext/{directories}/{asset}

Summary

Retrieve an asset installed in the modules database associated with a REST API instance, such as a dependent library of a module implementing an extension or a transformation. The asset should have the database URI /ext/{directories}/{asset}.

Request Headers
Accept? The expected MIME type of the data in the response body. You are responsible for selecting the correct type for the asset being retrieved. Content negotiation is not supported.
Response Headers
Content-type? The MIME type of the data in the response body, derived from the Accept header.

Response

Upon successful completion, MarkLogic Server responds with status code 200 (OK) and returns the asset in the response body. If no asset is found with the specified URI, MarkLogic Server returns status code 404 (Not Found).

Required Privileges

This operation requires the rest-admin role, or the following privileges:

http://marklogic.com/xdmp/privileges/rest-admin

http://marklogic.com/xdmp/privileges/rest-reader

http://marklogic.com/xdmp/privileges/rest-writer

Usage Notes

/ext/{directories}/{asset} should be the document URI of the asset in the modules database, where {directories} is one or more database directory path steps, separated by "/", and {asset} is the asset document. For example, if the asset is inserted into the database with the document URI /ext/your/domain/your-module.xqy then the request URL is of the form http://localhost:port/v1/ext/your/domain/your-module.xqy.

The response returns the asset with a Content-type corresponding to the MIME type in the Accept header. No content negotiation is supported. For example, if you specify application/xml in the Accept header, but retrieve a binary JPG document, then the response will have Content-type application/xml, even though the body actually contains JPG.

For more details, see Managing Dependent Libraries and Other Assets in the REST Application Developer's Guide.

Example

$ curl --anyauth --user user:password -i -X GET  \
    'http://localhost:8000/v1/ext/my/example/my-lib.xqy'

==> MarkLogic Server returns the XQuery library module in the modules
    database with the document URI /ext/my/example/my-lib.xqy. The response
    headers are similar to the following:

HTTP/1.1 200 OK
Content-type: application/xml
Server: MarkLogic
Content-Length: 633
Connection: Keep-Alive
Keep-Alive: timeout=5
  

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.